<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>bfpy.bftimezone</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="bfpy-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/bfpy/">BfPy</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="bfpy-module.html">Package&nbsp;bfpy</a> ::
        Module&nbsp;bftimezone
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="bfpy.bftimezone-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="bfpy.bftimezone-module.html">Module bfpy.bftimezone</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/env python</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: latin-1; py-indent-offset:4 -*-</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment">################################################################################</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"># </tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"># This file is part of BfPy</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"># BfPy is a Python library to communicate with the Betfair Betting Exchange</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (C) 2010 Daniel Rodriguez (aka Daniel Rodriksson)</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"># Copyright (C) 2011 Sensible Odds Ltd.</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"># You can learn more and contact the author at:</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment">#    http://code.google.com/p/bfpy/</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment"># BfPy is free software: you can redistribute it and/or modify</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment"># it under the terms of the GNU General Public License as published by</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-comment"># the Free Software Foundation, either version 3 of the License, or</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-comment"># (at your option) any later version.</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-comment"># BfPy is distributed in the hope that it will be useful,</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-comment"># GNU General Public License for more details.</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"><tt class="py-comment"># You should have received a copy of the GNU General Public License</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-comment"># along with BfPy. If not, see &lt;http://www.gnu.org/licenses/&gt;.</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"><tt class="py-comment">#</tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-comment">################################################################################</tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-docstring">'''</tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-docstring">BfPy Timezone classes. Adapted (if needed) from the Python documentation to make</tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-docstring">them more generic</tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-docstring">'''</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">calendar</tt> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">datetime</tt> <tt class="py-keyword">import</tt> <tt class="py-name">datetime</tt><tt class="py-op">,</tt> <tt class="py-name">timedelta</tt><tt class="py-op">,</tt> <tt class="py-name">tzinfo</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">time</tt> <tt class="py-keyword">as</tt> <tt class="py-name">_time</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"> </tt>
<a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-0" class="py-name" targets="Module bfpy.bfglobals=bfpy.bfglobals-module.html"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-0', 'bfglobals', 'link-0');">bfglobals</a></tt> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line"> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"><tt id="link-1" class="py-name" targets="Variable bfpy.bftimezone.ZERO=bfpy.bftimezone-module.html#ZERO"><a title="bfpy.bftimezone.ZERO" class="py-name" href="#" onclick="return doclink('link-1', 'ZERO', 'link-1');">ZERO</a></tt> <tt class="py-op">=</tt> <tt class="py-name">timedelta</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L42"></a><tt class="py-lineno"> 42</tt>  <tt class="py-line"> </tt>
<a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line"> </tt>
<a name="UTC"></a><div id="UTC-def"><a name="L44"></a><tt class="py-lineno"> 44</tt> <a class="py-toggle" href="#" id="UTC-toggle" onclick="return toggle('UTC');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="bfpy.bftimezone.UTC-class.html">UTC</a><tt class="py-op">(</tt><tt class="py-base-class">tzinfo</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UTC-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="UTC-expanded"><a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line"><tt class="py-docstring">    UTC timezone.</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="UTC.utcoffset"></a><div id="UTC.utcoffset-def"><a name="L48"></a><tt class="py-lineno"> 48</tt> <a class="py-toggle" href="#" id="UTC.utcoffset-toggle" onclick="return toggle('UTC.utcoffset');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone.UTC-class.html#utcoffset">utcoffset</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UTC.utcoffset-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="UTC.utcoffset-expanded"><a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-docstring">        Return the offset to UTC (GMT) for the given datetime</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line"><tt class="py-docstring">        @param dt: datetime to see offset against</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line"><tt class="py-docstring">        @type dt: datetime</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-2" class="py-name"><a title="bfpy.bftimezone.ZERO" class="py-name" href="#" onclick="return doclink('link-2', 'ZERO', 'link-1');">ZERO</a></tt> </tt>
</div><a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line"> </tt>
<a name="UTC.tzname"></a><div id="UTC.tzname-def"><a name="L57"></a><tt class="py-lineno"> 57</tt> <a class="py-toggle" href="#" id="UTC.tzname-toggle" onclick="return toggle('UTC.tzname');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone.UTC-class.html#tzname">tzname</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UTC.tzname-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="UTC.tzname-expanded"><a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line"><tt class="py-docstring">        Return the name of this timezone for the given datetime</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line"><tt class="py-docstring">        @param dt: datetime to see offset against</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"><tt class="py-docstring">        @type dt: datetime</tt> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">"UTC"</tt> </tt>
</div><a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line"> </tt>
<a name="UTC.dst"></a><div id="UTC.dst-def"><a name="L66"></a><tt class="py-lineno"> 66</tt> <a class="py-toggle" href="#" id="UTC.dst-toggle" onclick="return toggle('UTC.dst');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone.UTC-class.html#dst">dst</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="UTC.dst-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="UTC.dst-expanded"><a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"><tt class="py-docstring">        Return the daylight savings offset for the given datetime</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line"><tt class="py-docstring">        @param dt: datetime to see offset against</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line"><tt class="py-docstring">        @type dt: datetime</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-3" class="py-name"><a title="bfpy.bftimezone.ZERO" class="py-name" href="#" onclick="return doclink('link-3', 'ZERO', 'link-1');">ZERO</a></tt> </tt>
</div></div><a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line"> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line"> </tt>
<a name="LocalTimezone"></a><div id="LocalTimezone-def"><a name="L76"></a><tt class="py-lineno"> 76</tt> <a class="py-toggle" href="#" id="LocalTimezone-toggle" onclick="return toggle('LocalTimezone');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="bfpy.bftimezone.LocalTimezone-class.html">LocalTimezone</a><tt class="py-op">(</tt><tt class="py-base-class">tzinfo</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="LocalTimezone-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="LocalTimezone-expanded"><a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">    System specific local timezone.</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">    As seen in the Python docs (with mods)</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="LocalTimezone.__init__"></a><div id="LocalTimezone.__init__-def"><a name="L82"></a><tt class="py-lineno"> 82</tt> <a class="py-toggle" href="#" id="LocalTimezone.__init__-toggle" onclick="return toggle('LocalTimezone.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone.LocalTimezone-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="LocalTimezone.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="LocalTimezone.__init__-expanded"><a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">stdOffset</tt> <tt class="py-op">=</tt> <tt class="py-name">timedelta</tt><tt class="py-op">(</tt><tt class="py-name">seconds</tt><tt class="py-op">=</tt><tt class="py-op">-</tt><tt class="py-name">_time</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Variable bfpy.bftypes.GetBetHistoryReq.timezone=bfpy.bftypes.GetBetHistoryReq-class.html#timezone,Variable bfpy.bftypes.GetCurrentBetsReq.timezone=bfpy.bftypes.GetCurrentBetsReq-class.html#timezone"><a title="bfpy.bftypes.GetBetHistoryReq.timezone
bfpy.bftypes.GetCurrentBetsReq.timezone" class="py-name" href="#" onclick="return doclink('link-4', 'timezone', 'link-4');">timezone</a></tt><tt class="py-op">)</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">_time</tt><tt class="py-op">.</tt><tt class="py-name">daylight</tt><tt class="py-op">:</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dstOffset</tt> <tt class="py-op">=</tt> <tt class="py-name">timedelta</tt><tt class="py-op">(</tt><tt class="py-name">seconds</tt><tt class="py-op">=</tt><tt class="py-op">-</tt><tt class="py-name">_time</tt><tt class="py-op">.</tt><tt class="py-name">altzone</tt><tt class="py-op">)</tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dstOffset</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">stdOffset</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dstDiff</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dstOffset</tt> <tt class="py-op">-</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">stdOffset</tt> </tt>
</div><a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line"> </tt>
<a name="LocalTimezone.utcoffset"></a><div id="LocalTimezone.utcoffset-def"><a name="L91"></a><tt class="py-lineno"> 91</tt> <a class="py-toggle" href="#" id="LocalTimezone.utcoffset-toggle" onclick="return toggle('LocalTimezone.utcoffset');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone.LocalTimezone-class.html#utcoffset">utcoffset</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="LocalTimezone.utcoffset-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="LocalTimezone.utcoffset-expanded"><a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line"><tt class="py-docstring">        Return the offset to UTC (GMT) for the given datetime</tt> </tt>
<a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line"><tt class="py-docstring">        @param dt: datetime to see offset against</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line"><tt class="py-docstring">        @type dt: datetime</tt> </tt>
<a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dstOffset</tt> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Method bfpy.bftimezone.LocalTimezone._isdst()=bfpy.bftimezone.LocalTimezone-class.html#_isdst"><a title="bfpy.bftimezone.LocalTimezone._isdst" class="py-name" href="#" onclick="return doclink('link-5', '_isdst', 'link-5');">_isdst</a></tt><tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">)</tt> <tt class="py-keyword">else</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">stdOffset</tt> </tt>
</div><a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"> </tt>
<a name="LocalTimezone.dst"></a><div id="LocalTimezone.dst-def"><a name="L100"></a><tt class="py-lineno">100</tt> <a class="py-toggle" href="#" id="LocalTimezone.dst-toggle" onclick="return toggle('LocalTimezone.dst');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone.LocalTimezone-class.html#dst">dst</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="LocalTimezone.dst-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="LocalTimezone.dst-expanded"><a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"><tt class="py-docstring">        Return the daylight savings offset for the given datetime</tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"><tt class="py-docstring">        @param dt: datetime to see offset against</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-docstring">        @type dt: datetime</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">dstDiff</tt> <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name"><a title="bfpy.bftimezone.LocalTimezone._isdst" class="py-name" href="#" onclick="return doclink('link-6', '_isdst', 'link-5');">_isdst</a></tt><tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">)</tt> <tt class="py-keyword">else</tt> <tt id="link-7" class="py-name"><a title="bfpy.bftimezone.ZERO" class="py-name" href="#" onclick="return doclink('link-7', 'ZERO', 'link-1');">ZERO</a></tt> </tt>
</div><a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"> </tt>
<a name="LocalTimezone.tzname"></a><div id="LocalTimezone.tzname-def"><a name="L109"></a><tt class="py-lineno">109</tt> <a class="py-toggle" href="#" id="LocalTimezone.tzname-toggle" onclick="return toggle('LocalTimezone.tzname');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone.LocalTimezone-class.html#tzname">tzname</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="LocalTimezone.tzname-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="LocalTimezone.tzname-expanded"><a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-docstring">        Return the name of this timezone for the given datetime</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">        @param dt: datetime to see offset against</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-docstring">        @type dt: datetime</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">_time</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name" targets="Method bfpy.bftimezone.LocalTimezone.tzname()=bfpy.bftimezone.LocalTimezone-class.html#tzname,Method bfpy.bftimezone.UTC.tzname()=bfpy.bftimezone.UTC-class.html#tzname"><a title="bfpy.bftimezone.LocalTimezone.tzname
bfpy.bftimezone.UTC.tzname" class="py-name" href="#" onclick="return doclink('link-8', 'tzname', 'link-8');">tzname</a></tt><tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="bfpy.bftimezone.LocalTimezone._isdst" class="py-name" href="#" onclick="return doclink('link-9', '_isdst', 'link-5');">_isdst</a></tt><tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
</div><a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line"> </tt>
<a name="LocalTimezone._isdst"></a><div id="LocalTimezone._isdst-def"><a name="L118"></a><tt class="py-lineno">118</tt> <a class="py-toggle" href="#" id="LocalTimezone._isdst-toggle" onclick="return toggle('LocalTimezone._isdst');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone.LocalTimezone-class.html#_isdst">_isdst</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="LocalTimezone._isdst-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="LocalTimezone._isdst-expanded"><a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line"><tt class="py-docstring">        Private function to find out if the system reports</tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"><tt class="py-docstring">        to be in DST mode for the given datetime</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line"><tt class="py-docstring">        @param dt: datetime to see offset against</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line"><tt class="py-docstring">        @type dt: datetime</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">        <tt class="py-name">tt</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">year</tt><tt class="py-op">,</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">month</tt><tt class="py-op">,</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">day</tt><tt class="py-op">,</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">hour</tt><tt class="py-op">,</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">minute</tt><tt class="py-op">,</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">second</tt><tt class="py-op">,</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">weekday</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">        <tt class="py-name">stamp</tt> <tt class="py-op">=</tt> <tt class="py-name">_time</tt><tt class="py-op">.</tt><tt class="py-name">mktime</tt><tt class="py-op">(</tt><tt class="py-name">tt</tt><tt class="py-op">)</tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line">        <tt class="py-name">tt</tt> <tt class="py-op">=</tt> <tt class="py-name">_time</tt><tt class="py-op">.</tt><tt class="py-name">localtime</tt><tt class="py-op">(</tt><tt class="py-name">stamp</tt><tt class="py-op">)</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">tt</tt><tt class="py-op">.</tt><tt class="py-name">tm_isdst</tt> <tt class="py-op">&gt;</tt> <tt class="py-number">0</tt> </tt>
</div></div><a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"> </tt>
<a name="localizeDateTime"></a><div id="localizeDateTime-def"><a name="L132"></a><tt class="py-lineno">132</tt> <a class="py-toggle" href="#" id="localizeDateTime-toggle" onclick="return toggle('localizeDateTime');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone-module.html#localizeDateTime">localizeDateTime</a><tt class="py-op">(</tt><tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="localizeDateTime-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="localizeDateTime-expanded"><a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line"><tt class="py-docstring">    Given a datetime.datetime instance it localizes the time to the local system</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line"><tt class="py-docstring">    (according to bfglobals settings) and adds a timezone object if needed</tt> </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-10" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-10', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Variable bfpy.bfglobals.timeUtc=bfpy.bfglobals-module.html#timeUtc,Variable bfpy.timeUtc=bfpy-module.html#timeUtc"><a title="bfpy.bfglobals.timeUtc
bfpy.timeUtc" class="py-name" href="#" onclick="return doclink('link-11', 'timeUtc', 'link-11');">timeUtc</a></tt> <tt class="py-keyword">or</tt> <tt id="link-12" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-12', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Variable bfpy.bfglobals.timeUtcIn=bfpy.bfglobals-module.html#timeUtcIn,Variable bfpy.timeUtcIn=bfpy-module.html#timeUtcIn"><a title="bfpy.bfglobals.timeUtcIn
bfpy.timeUtcIn" class="py-name" href="#" onclick="return doclink('link-13', 'timeUtcIn', 'link-13');">timeUtcIn</a></tt><tt class="py-op">:</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">        <tt class="py-comment"># Calling application wants utc</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">        <tt class="py-name">tmpdt</tt> <tt class="py-op">=</tt> <tt class="py-name">dt</tt> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-14" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-14', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Variable bfpy.bfglobals.timeReturnAware=bfpy.bfglobals-module.html#timeReturnAware,Variable bfpy.timeReturnAware=bfpy-module.html#timeReturnAware"><a title="bfpy.bfglobals.timeReturnAware
bfpy.timeReturnAware" class="py-name" href="#" onclick="return doclink('link-15', 'timeReturnAware', 'link-15');">timeReturnAware</a></tt> <tt class="py-keyword">else</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-name">tzinfo</tt><tt class="py-op">=</tt><tt id="link-16" class="py-name" targets="Class bfpy.bftimezone.UTC=bfpy.bftimezone.UTC-class.html"><a title="bfpy.bftimezone.UTC" class="py-name" href="#" onclick="return doclink('link-16', 'UTC', 'link-16');">UTC</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">tmpdt</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line"> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">    <tt class="py-comment"># Localized time wished</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">    <tt class="py-name">localTimezone</tt> <tt class="py-op">=</tt> <tt id="link-17" class="py-name" targets="Class bfpy.bftimezone.LocalTimezone=bfpy.bftimezone.LocalTimezone-class.html"><a title="bfpy.bftimezone.LocalTimezone" class="py-name" href="#" onclick="return doclink('link-17', 'LocalTimezone', 'link-17');">LocalTimezone</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">        <tt id="link-18" class="py-name" targets="Method bfpy.bftimezone.LocalTimezone.utcoffset()=bfpy.bftimezone.LocalTimezone-class.html#utcoffset,Method bfpy.bftimezone.UTC.utcoffset()=bfpy.bftimezone.UTC-class.html#utcoffset"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-18', 'utcoffset', 'link-18');">utcoffset</a></tt> <tt class="py-op">=</tt> <tt class="py-name">localTimezone</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-19', 'utcoffset', 'link-18');">utcoffset</a></tt><tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">)</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">        <tt class="py-comment"># Fails with the dates from getSubscriptionInfo</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">        <tt class="py-comment"># Generate an offset for our current time</tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line">        <tt id="link-20" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-20', 'utcoffset', 'link-18');">utcoffset</a></tt> <tt class="py-op">=</tt> <tt class="py-name">localTimezone</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-21', 'utcoffset', 'link-18');">utcoffset</a></tt><tt class="py-op">(</tt><tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">now</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line">    <tt class="py-name">tmpdt</tt> <tt class="py-op">=</tt> <tt class="py-name">dt</tt> <tt class="py-op">+</tt> <tt id="link-22" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-22', 'utcoffset', 'link-18');">utcoffset</a></tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-23" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-23', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-24" class="py-name"><a title="bfpy.bfglobals.timeReturnAware
bfpy.timeReturnAware" class="py-name" href="#" onclick="return doclink('link-24', 'timeReturnAware', 'link-15');">timeReturnAware</a></tt><tt class="py-op">:</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line">        <tt class="py-name">tmpdt</tt> <tt class="py-op">=</tt> <tt class="py-name">tmpdt</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-name">tzinfo</tt><tt class="py-op">=</tt><tt class="py-name">localTimezone</tt><tt class="py-op">)</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line"> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">tmpdt</tt> </tt>
</div><a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line"> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line"> </tt>
<a name="unLocalizeDateTime"></a><div id="unLocalizeDateTime-def"><a name="L159"></a><tt class="py-lineno">159</tt> <a class="py-toggle" href="#" id="unLocalizeDateTime-toggle" onclick="return toggle('unLocalizeDateTime');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone-module.html#unLocalizeDateTime">unLocalizeDateTime</a><tt class="py-op">(</tt><tt class="py-param">dt</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="unLocalizeDateTime-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="unLocalizeDateTime-expanded"><a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"><tt class="py-docstring">    Given a datetime.datetime instance it unlocalizes it (according to bfglobals settings)</tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line"><tt class="py-docstring">    and honours a timezone object if needed</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-25" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-25', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-26" class="py-name"><a title="bfpy.bfglobals.timeUtc
bfpy.timeUtc" class="py-name" href="#" onclick="return doclink('link-26', 'timeUtc', 'link-11');">timeUtc</a></tt> <tt class="py-keyword">or</tt> <tt id="link-27" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-27', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-28" class="py-name" targets="Variable bfpy.bfglobals.timeUtcOut=bfpy.bfglobals-module.html#timeUtcOut,Variable bfpy.timeUtcOut=bfpy-module.html#timeUtcOut"><a title="bfpy.bfglobals.timeUtcOut
bfpy.timeUtcOut" class="py-name" href="#" onclick="return doclink('link-28', 'timeUtcOut', 'link-28');">timeUtcOut</a></tt><tt class="py-op">:</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">        <tt class="py-comment"># Calling application is passing utc</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-name">tzinfo</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt> </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">         </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">    <tt id="link-29" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-29', 'utcoffset', 'link-18');">utcoffset</a></tt> <tt class="py-op">=</tt> <tt id="link-30" class="py-name"><a title="bfpy.bftimezone.ZERO" class="py-name" href="#" onclick="return doclink('link-30', 'ZERO', 'link-1');">ZERO</a></tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-31" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-31', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-32" class="py-name" targets="Variable bfpy.bfglobals.timeHonourAware=bfpy.bfglobals-module.html#timeHonourAware,Variable bfpy.timeHonourAware=bfpy-module.html#timeHonourAware"><a title="bfpy.bfglobals.timeHonourAware
bfpy.timeHonourAware" class="py-name" href="#" onclick="return doclink('link-32', 'timeHonourAware', 'link-32');">timeHonourAware</a></tt><tt class="py-op">:</tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">        <tt id="link-33" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-33', 'utcoffset', 'link-18');">utcoffset</a></tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> <tt class="py-keyword">if</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">tzinfo</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">else</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt id="link-34" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-34', 'utcoffset', 'link-18');">utcoffset</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line"> </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-35" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-35', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-36" class="py-name"><a title="bfpy.bfglobals.timeHonourAware
bfpy.timeHonourAware" class="py-name" href="#" onclick="return doclink('link-36', 'timeHonourAware', 'link-32');">timeHonourAware</a></tt> <tt class="py-keyword">or</tt> <tt id="link-37" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-37', 'utcoffset', 'link-18');">utcoffset</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">        <tt class="py-name">localTimezone</tt> <tt class="py-op">=</tt> <tt id="link-38" class="py-name"><a title="bfpy.bftimezone.LocalTimezone" class="py-name" href="#" onclick="return doclink('link-38', 'LocalTimezone', 'link-17');">LocalTimezone</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">            <tt id="link-39" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-39', 'utcoffset', 'link-18');">utcoffset</a></tt> <tt class="py-op">=</tt> <tt class="py-name">localTimezone</tt><tt class="py-op">.</tt><tt id="link-40" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-40', 'utcoffset', 'link-18');">utcoffset</a></tt><tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">)</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">            <tt class="py-comment"># Fails with the dates from getSubscriptionInfo</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line">            <tt class="py-comment"># generate an offset for our current time</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">            <tt id="link-41" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-41', 'utcoffset', 'link-18');">utcoffset</a></tt> <tt class="py-op">=</tt> <tt class="py-name">localTimezone</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-42', 'utcoffset', 'link-18');">utcoffset</a></tt><tt class="py-op">(</tt><tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">now</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line"> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">dt</tt> <tt class="py-op">-</tt> <tt id="link-43" class="py-name"><a title="bfpy.bftimezone.LocalTimezone.utcoffset
bfpy.bftimezone.UTC.utcoffset" class="py-name" href="#" onclick="return doclink('link-43', 'utcoffset', 'link-18');">utcoffset</a></tt> </tt>
</div><a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line"> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line"> </tt>
<a name="parseDateTimeString"></a><div id="parseDateTimeString-def"><a name="L184"></a><tt class="py-lineno">184</tt> <a class="py-toggle" href="#" id="parseDateTimeString-toggle" onclick="return toggle('parseDateTimeString');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone-module.html#parseDateTimeString">parseDateTimeString</a><tt class="py-op">(</tt><tt class="py-param">dtString</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="parseDateTimeString-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="parseDateTimeString-expanded"><a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line"><tt class="py-docstring">    Parses an incoming datetime string and returns a datetimeobject</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line"><tt class="py-docstring">    (localized or not according to preferences)</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">    <tt class="py-comment"># Bf time is: 2000-01-01T00:00:00.000Z</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">    <tt class="py-name">dtParts</tt> <tt class="py-op">=</tt> <tt class="py-name">dtString</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'.'</tt><tt class="py-op">)</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">    <tt class="py-name">dt</tt> <tt class="py-op">=</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">strptime</tt><tt class="py-op">(</tt><tt class="py-name">dtParts</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-string">'%Y-%m-%dT%H:%M:%S'</tt><tt class="py-op">)</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">    <tt class="py-name">dt</tt> <tt class="py-op">=</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-name">microsecond</tt><tt class="py-op">=</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">dtParts</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-number">1000</tt><tt class="py-op">)</tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line"> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-44" class="py-name" targets="Function bfpy.bftimezone.localizeDateTime()=bfpy.bftimezone-module.html#localizeDateTime"><a title="bfpy.bftimezone.localizeDateTime" class="py-name" href="#" onclick="return doclink('link-44', 'localizeDateTime', 'link-44');">localizeDateTime</a></tt><tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">)</tt> </tt>
</div><a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">     </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line"> </tt>
<a name="fromTimestamp"></a><div id="fromTimestamp-def"><a name="L197"></a><tt class="py-lineno">197</tt> <a class="py-toggle" href="#" id="fromTimestamp-toggle" onclick="return toggle('fromTimestamp');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone-module.html#fromTimestamp">fromTimestamp</a><tt class="py-op">(</tt><tt class="py-param">ts</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="fromTimestamp-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="fromTimestamp-expanded"><a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line"><tt class="py-docstring">    Parses an incoming timestamp and returns a datetimeobject</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line"><tt class="py-docstring">    (localized or not according to preferences)</tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-45" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-45', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-46" class="py-name" targets="Variable bfpy.bfglobals.timeConvertTimestamps=bfpy.bfglobals-module.html#timeConvertTimestamps,Variable bfpy.timeConvertTimestamps=bfpy-module.html#timeConvertTimestamps"><a title="bfpy.bfglobals.timeConvertTimestamps
bfpy.timeConvertTimestamps" class="py-name" href="#" onclick="return doclink('link-46', 'timeConvertTimestamps', 'link-46');">timeConvertTimestamps</a></tt><tt class="py-op">:</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ts</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line"> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">    <tt class="py-name">secs</tt><tt class="py-op">,</tt> <tt class="py-name">msecs</tt> <tt class="py-op">=</tt> <tt class="py-name">divmod</tt><tt class="py-op">(</tt><tt class="py-name">ts</tt><tt class="py-op">,</tt> <tt class="py-number">1000</tt><tt class="py-op">)</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line"> </tt>
<a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">    <tt class="py-name">dt</tt> <tt class="py-op">=</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">utcfromtimestamp</tt><tt class="py-op">(</tt><tt class="py-name">secs</tt><tt class="py-op">)</tt> </tt>
<a name="L208"></a><tt class="py-lineno">208</tt>  <tt class="py-line">    <tt class="py-name">dt</tt> <tt class="py-op">=</tt> <tt class="py-name">dt</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-name">microsecond</tt><tt class="py-op">=</tt><tt class="py-name">msecs</tt> <tt class="py-op">*</tt> <tt class="py-number">1000</tt><tt class="py-op">)</tt> </tt>
<a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-47" class="py-name"><a title="bfpy.bftimezone.localizeDateTime" class="py-name" href="#" onclick="return doclink('link-47', 'localizeDateTime', 'link-44');">localizeDateTime</a></tt><tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">)</tt> </tt>
</div><a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line"> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line"> </tt>
<a name="fromTimestampString"></a><div id="fromTimestampString-def"><a name="L212"></a><tt class="py-lineno">212</tt> <a class="py-toggle" href="#" id="fromTimestampString-toggle" onclick="return toggle('fromTimestampString');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone-module.html#fromTimestampString">fromTimestampString</a><tt class="py-op">(</tt><tt class="py-param">tstamp</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="fromTimestampString-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="fromTimestampString-expanded"><a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line"><tt class="py-docstring">    Parses an incoming timestamp string and returns a datetimeobject</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line"><tt class="py-docstring">    (localized or not according to preferences)</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line">    <tt class="py-name">ts</tt> <tt class="py-op">=</tt> <tt class="py-name">long</tt><tt class="py-op">(</tt><tt id="link-48" class="py-name" targets="Variable bfpy.bfcounter.DataRequest.tstamp=bfpy.bfcounter.DataRequest-class.html#tstamp"><a title="bfpy.bfcounter.DataRequest.tstamp" class="py-name" href="#" onclick="return doclink('link-48', 'tstamp', 'link-48');">tstamp</a></tt><tt class="py-op">)</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-49" class="py-name" targets="Function bfpy.bftimezone.fromTimestamp()=bfpy.bftimezone-module.html#fromTimestamp"><a title="bfpy.bftimezone.fromTimestamp" class="py-name" href="#" onclick="return doclink('link-49', 'fromTimestamp', 'link-49');">fromTimestamp</a></tt><tt class="py-op">(</tt><tt class="py-name">ts</tt><tt class="py-op">)</tt> </tt>
</div><a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line"> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line"> </tt>
<a name="getDateTimeNow"></a><div id="getDateTimeNow-def"><a name="L221"></a><tt class="py-lineno">221</tt> <a class="py-toggle" href="#" id="getDateTimeNow-toggle" onclick="return toggle('getDateTimeNow');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone-module.html#getDateTimeNow">getDateTimeNow</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="getDateTimeNow-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="getDateTimeNow-expanded"><a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line"><tt class="py-docstring">    Returns the current time either in local time or utc</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line"><tt class="py-docstring">    according to the preferences in bfglobals. This datetime</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line"><tt class="py-docstring">    object is meant to be sent to the API servers</tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-50" class="py-name"><a title="bfpy.bfglobals" class="py-name" href="#" onclick="return doclink('link-50', 'bfglobals', 'link-0');">bfglobals</a></tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="bfpy.bfglobals.timeUtc
bfpy.timeUtc" class="py-name" href="#" onclick="return doclink('link-51', 'timeUtc', 'link-11');">timeUtc</a></tt> <tt class="py-keyword">or</tt> <tt class="py-name">bfGlobals</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name"><a title="bfpy.bfglobals.timeUtcOut
bfpy.timeUtcOut" class="py-name" href="#" onclick="return doclink('link-52', 'timeUtcOut', 'link-28');">timeUtcOut</a></tt><tt class="py-op">:</tt> </tt>
<a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">utcnow</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L229"></a><tt class="py-lineno">229</tt>  <tt class="py-line"> </tt>
<a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">now</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line">     </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line"> </tt>
<a name="getDateTime"></a><div id="getDateTime-def"><a name="L233"></a><tt class="py-lineno">233</tt> <a class="py-toggle" href="#" id="getDateTime-toggle" onclick="return toggle('getDateTime');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="bfpy.bftimezone-module.html#getDateTime">getDateTime</a><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="getDateTime-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="getDateTime-expanded"><a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line"><tt class="py-docstring">    Constructs an internal datetime object to be sent to the</tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line"><tt class="py-docstring">    API servers unlocalized if so set in the bfglobals</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">    <tt class="py-name">dt</tt> <tt class="py-op">=</tt> <tt class="py-name">datetime</tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">args</tt><tt class="py-op">)</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-53" class="py-name" targets="Function bfpy.bftimezone.unLocalizeDateTime()=bfpy.bftimezone-module.html#unLocalizeDateTime"><a title="bfpy.bftimezone.unLocalizeDateTime" class="py-name" href="#" onclick="return doclink('link-53', 'unLocalizeDateTime', 'link-53');">unLocalizeDateTime</a></tt><tt class="py-op">(</tt><tt class="py-name">dt</tt><tt class="py-op">)</tt> </tt>
</div><a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="bfpy-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/bfpy/">BfPy</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sat Jun 04 02:13:37 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
